require 'rails_helper'

RSpec.describe <%= class_name %>Cell, type: :cell do

  context 'cell rendering' do
  <%- actions.each_with_index do |state, index| -%>
    context 'rendering <%= state %>' do
      subject { cell(<%= cell_name %>, <%= class_name %>.new).call(:<%= state %>) }

      <%- if defined?(::Capybara) -%>
      it { is_expected.to have_selector('h1', text: '<%= class_name %>#<%= state %>') }
      it { is_expected.to have_selector('p', text: 'Find me in app/cells/<%= file_path %>/<%= state %>.<%= template_engine %>') }
      <%- else -%>
      it { is_expected.to include '<%= class_name %>#<%= state %>' }
      it { is_expected.to include 'Find me in app/cells/<%= file_path %>/<%= state %>.<%= template_engine %>' }
      <%- end -%>
    end
    <%- unless index == actions.length - 1 -%>

    <%- end -%>
  <%- end -%>
  end

end
